import Vue from "vue";
import VueRouter from "vue-router";
import LayOut from "../layout/index.vue";
import AppMain from '../layout/components/appMain.vue'

Vue.use(VueRouter);

// 静态路由
export const constRoutes = [
  // Demo案例列表
  {
    path: "/layout",
    name: "layout",
    component: LayOut,
    redirect: "/banner",
    children: [
      {
        path: "/charlie/myInfo",
        component: () => import("../views/Charlie/MyInfo/index.vue"),
        name: "个人简历",
        hidden: false,
        meta: { title: "个人简历", icon: "icon-image-text" },
      },
      {
        path: "/banner",
        name: "完美男人",
        hidden: true,
        component: () => import("../views/banner.vue"),
        meta: { title: "完美男人", icon: "icon-haiwaitequan" },
      },
      {
        path: "/demo",
        name: "展示案例",
        hidden: false,
        component: AppMain,
        // component: () => import("../views/404.vue"),
        meta: { title: "展示案例", icon: "icon-gallery" },
        children: [
          {
            path: "/profile",
            component: () => import("../views/404.vue"),
            name: "个人中心",
            hidden: true,
            meta: { title: "个人中心", icon: "icon-haiwaitequan" },
            children: [
              {
                path: "/profile1",
                component: () => import("../views/404.vue"),
                name: "个人中心1",
                meta: { title: "个人中心1", icon: "icon-haiwaitequan" },
              },
            ],
          },
          {
            path: "/print",
            component: () => import("../views/Demo/print/index.vue"),
            name: "打印",
            meta: { title: "打印", icon: "icon-print" },
          },
          {
            path: "/printEdit",
            component: () => import("../views/Demo/print/components/printEdit.vue"),
            name: "Print",
            hidden: true,
            meta: { title: "打印修改", icon: "icon-print" },
          },
          {
            path: "/workFlow",
            component: () => import("../views/Demo/workFlow/index.vue"),
            name: "工作流",
            meta: { title: "工作流", icon: "icon-gongyinglianfuwu" },
            children: [
              {
                path: "/profile1",
                component: () => import("../views/404.vue"),
                name: "个人中心1",
                meta: { title: "个人中心1", icon: "icon-haiwaitequan" },
              },
            ],
          },
        ],
      },
      {
        path: "/charlie",
        name: "Charlie",
        hidden: true,
        component: AppMain,
        // component: () => import("../views/Charlie/MyHome/index.vue"),
        // redirect: "/myhome",
        meta: { title: "Charlie", icon: "icon-customer-interests" },
        children: [
          {
            path: "/charlie/myhome",
            component: () => import("../views/Charlie/MyHome/index.vue"),
            name: "个人中心",
            hidden: true,
            meta: { title: "个人中心", icon: "icon-customer-certified-fill" },
          },
        ]
      },
    ],
  },
  {
    path: "/",
    name: "首页",
    hidden: true,
    component: () => import("../views/login.vue"),
  },
  {
    path: "/404",
    name: "404",
    hidden: true,
    component: () => import("../views/404.vue"),
  },
];

// 动态路由
const asyncRoutes = [];

const routes = [...constRoutes, ...asyncRoutes];

const router = new VueRouter({
  routes,
});

export default router;
